package top.yxqz.number2.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.yxqz.number2.dao.UserDao;
import top.yxqz.number2.entity.User;
import top.yxqz.number2.service.UserService;

/**
 * @author: 余小小
 * @date: 2023/9/11
 * @description：
 */
@Service
public class UserServiceImpl implements UserService {

    //    注入数据层
    @Autowired
    private UserDao userDao;


    @Override
    public User getUserObj() {
        User user = userDao.getUserObj();
        if (user.getUsername().equals("admin")) {
            user.setUsername("管理员");
        }
        return user;
    }
}
